<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xml:lang="en" lang="en"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">
<f:view contentType="text/html">

<h:head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
    <title>GPicS</title>
    <!-- add your meta tags here -->
    <script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>
    <link href="yaml/css/my_layout.css" rel="stylesheet" type="text/css"/>
    <!--[if lte IE 7]>
    <link href="css/patches/patch_my_layout.css" rel="stylesheet" type="text/css" />
    <![endif]-->
    <script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>
    <script type="text/javascript">
        function clickLink(linkId)
{
  var fireOnThis = document.getElementById("loginMask:btnLogin");
  if (document.createEvent)
  {
    var evObj = document.createEvent('MouseEvents');
    evObj.initEvent( 'click', true, false );
    fireOnThis.dispatchEvent(evObj);
  }
  else if (document.createEventObject)
  {
    fireOnThis.fireEvent('onclick');
  }
}
    </script>
</h:head>
<h:body>
    <div class="page_margins">
        <div id="border-top">
            <div id="edge-tl"></div>
            <div id="edge-tr"></div>
        </div>
        <div class="page">
            <div id="header">
                <!--<div id="topnav">-->
                <!--&lt;!&ndash; start: skip link navigation &ndash;&gt;-->
                <!--<a class="skip" title="skip link" href="#">Skip to the navigation</a><span class="hideme">.</span>-->
                <!--<a class="skip" title="skip link" href="#">Skip to the content</a><span class="hideme">.</span>-->
                <!--&lt;!&ndash; end: skip link navigation &ndash;&gt;<a href="#">Login</a> | <a href="#">Contact</a> | <a href="#">Imprint</a>-->
                <!--</div>-->
                <h:graphicImage value="gpics.jpg" width="12%" height="12%" />
                <h:outputLabel value="#{msg.headertext}"/>
            </div>
            <div id="main">
                <div id="col1">
                    <div id="col1_content" class="clearfix">
                        <h:form rendered="#{!userController.eingeloggt}" id="loginMask">
                            <table>
                                <tr>
                                    <td>
                                        <h:outputLabel value="#{msg.username} "/>
                                    </td>
                                    <td>
                                        <h:inputText value="#{userController.nutzerNamen}"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <h:outputLabel value="#{msg.password} "/>
                                    </td>
                                    <td>
                                        <h:inputSecret value="#{userController.passwort}" onkeydown="if (event.keyCode == 13) {clickLink('loginMask:btnLogin');}"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <h:commandLink id="btnLogin" value="#{msg.login}" action="#{userController.login}"/>
                                    </td>
                                </tr>
                            </table>
                            <table>
                                <tr>
                                    <td>
                                        <h:commandLink value="#{msg.newUser}" action="createUser"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td><h:commandLink value="#{msg.forgotPassword}" action="sendPW"/></td>
                                </tr>
                            </table>
                        </h:form>
                        <h:form rendered="#{userController.eingeloggt}">
                            <table>
                                <tr>
                                    <td>
                                        <h:commandLink value="#{userController.nutzerNamen} #{msg.logout}"
                                                       action="#{userController.logout}"/>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <h:commandLink value="#{msg.editUser}" action="createUser"/>
                                    </td>
                                </tr>
                            </table>
                        </h:form>

                        <h:messages for="loginMask" style="color:red;"/>

                        <h:form>


                            <h:commandLink value="#{msg.home}" action="index"/> <br/><br/>
                            <h:commandLink value="#{msg.ownAlbums}" action="#{ownAlbumsController.initAllAlbums}" rendered="#{userController.eingeloggt}">
                                <br/><br/>
                            </h:commandLink>
                            <h:commandLink value="#{msg.allAlbums}" action="#{albumsController.initAllAlbums}"/><br/><br/>
                            <h:commandLink value="#{msg.createAlbum}" action="#{createEditAlbumController.initCreateEditAlbumController}" rendered="#{userController.eingeloggt}"/><br/><br/>
                            <h:commandLink value="#{msg.adminPageText}" action="#{adminPageController.loadPage}" rendered="#{userController.admin}"/>
                        </h:form>
                                                

                        <ui:insert name="nav"/>
                    </div>
                </div>
                <div id="col3">
                    <div id="col3_content" class="clearfix">
                        <ui:insert name="content"/>
                    </div>
                    <!-- IE Column Clearing -->
                    <div id="ie_clearing"> &#160; </div>
                </div>
            </div>
            <!-- begin: #footer -->
            <div id="footer">&copy; by Stefan Radusch, Martin Schicht, Rico Scholz, Markus Ullrich <ui:insert name="footer"/>
            </div>
        </div>
        <div id="border-bottom">
            <div id="edge-bl"></div>
            <div id="edge-br"></div>
        </div>
    </div>
</h:body>
</f:view>
</html>
